class DataLoadService {

    boolean transactional = true

    def loadAll() {
      
      def now = new Date()
      def startNearlyNow = new Date(now.time + 7000)
      def endNearlyNow = new Date(now.time + 3607000)
      def startFuture = new Date(now.time + 9999990000)
      def endFuture = new Date(now.time + 9999999999)

      def u1 = new UserAccount(firstName: "Dale", lastName: "Manthei", email: "d@g.com", password: "pass").save()
      def u2 = new UserAccount(firstName: "Alison", lastName: "Manthei", email: "a@g.com", password: "pass").save()
      def e1 = new Event(name:"event1", description:"e1d1", location:"e1l1", startDate: startNearlyNow, endDate: endNearlyNow, administrator:u1).save()
      e1.addToPositions(new Position(name:"e1p1", description:"e1p1d1", location:"e1p1l1", startDate: startNearlyNow, endDate: endNearlyNow, requires: 1)).save()
      def e2 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      e2.addToPositions(new Position(name:"e2p1", description:"e2p1d1", location:"e2p1l1", startDate: startFuture, endDate: endFuture, requires: 1)).save()
      def e3 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e4 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e5 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e6 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e7 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e8 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e9 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e10 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e11 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e12 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()
      def e132 = new Event(name:"event2", description:"e2d1", location:"e1l1", startDate: startFuture, endDate: endFuture, administrator:u1).save()

    }
}
